<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="spring" uri="http://www.springframework.org/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
<head>
    <title><fmt:message key="htmlPage" /></title>
</head>
<body>
    <h1><fmt:message key="htmlPage" /></h1>
    <c:url var="updateUrl" value="/domain/htmlPage/updateMeta.action"/>
    <form:form action="${updateUrl}" id="htmlPageForm" modelAttribute="htmlPageForm" >
        <form:errors cssClass="error"/>
        <table>
            <form:hidden path="htmlPage.inode"/>
            <tbody>
                <tr>
                    <th><fmt:message key="htmlPage_title" /></th>
                    <td>
						${htmlPageForm.htmlPage.title}
                    </td>
                    <th><fmt:message key="htmlPage_friendlyName" /></th>
                    <td>
						${htmlPageForm.htmlPage.friendlyName}
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="htmlPage_path" /></th>
                    <td>
						${htmlPageForm.htmlPage.path}
                    </td>
                    <th><fmt:message key="htmlPage_template" /></th>
                    <td>
						${htmlPageForm.htmlPage.template.title}
                    </td>

                </tr>

                <tr>
                    <th><fmt:message key="htmlPage_metaData" /></th>
                    <td colspan="3">
                        <form:textarea path="htmlPage.metaData"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.metaData",
                                widgetType : "dijit.form.SimpleTextarea",
                                widgetAttrs : {
									rows: 20,
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.metaData"/>
                    </td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="4">
                        <div class="buttons">
                            <button id="updateButton" type="submit"><fmt:message key="label.form.submit"/></button>
                            <script type="text/javascript">
                                Spring.addDecoration(new Spring.ValidateAllDecoration({
                                    elementId:'updateButton',
                                    event:'onclick'
                                }));
                            </script>
                            <c:url var="showUrl" value="/domain/htmlPage/show.action">
                                <c:param name="htmlPage.inode" value="${htmlPageForm.htmlPage.inode}"/>
                            </c:url>
                            <a href="${showUrl}"><span><fmt:message key="label.link.show"/></span></a>
                        </div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </form:form>
</body>
